package com.econ.powercloud.ems.common.enums;

/**
 * @Author : zjf
 * @Description : 保护事件或SOE事件类型枚举
 * @Date : 2022/8/3 15:30
 * @Modified by : zjf
 */
public enum ProtectAndSoeEventType {
    PROTECT_EVENT(1, "保护事件"),
    SOE_EVENT(2, "SOE事件"),
    ;

    private Integer code;
    private String desc;

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    ProtectAndSoeEventType(int code, String desc){
        this.code=code;
        this.desc=desc;
    }

    public static String getCodeFromCode(int code){
        for(ProtectAndSoeEventType type: ProtectAndSoeEventType.values()){
            if(type.getCode() == code){
                return type.getDesc();
            }
        }
        return null;
    }
}

